<template>
	<view class="good-list">
		<uni-list>
			<uni-list-item v-for="(item,index) in list" :key="index" showArrow>
				<template slot="header">
					<view class="iconfont icon-yinzhang"></view>
				</template>
				<template slot="body" >
					<view class="u-cell-group" @click="navigetTo(item)" >
						<view>
							<u-tag :text="item.name" type="success" />
						</view>
						<view>{{$t('印章ID')}}：{{item.id}}</view>
						<view>{{$t('管章人')}}：{{item.keeperName}}</view>
					</view>
				</template>
				<template slot="footer" v-show="option.name=='我的印章'">
					<view class="footer" >
						<u-tag :text="$t('使用记录')" style="width:152rpx;" @click="printingRecord(item)"/>
					</view>
				</template>
			</uni-list-item>
		</uni-list>
	</view>
</template>

<script>
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	export default {
		computed: {
			...mapGetters(['userInfo', 'api']),
			computeType() {
				return (type) => {
					if (type == 0) {
						return '申请单模式'
					} else if (type == 1) {
						return '申请单模式(量子)'
					} else if (type == 2) {
						return '指纹模式'
					} else if (type == 3) {
						return '指纹模式(量子)'
					} else if (type == 4) {
						return '密码模式'
					}
				}
			}
		},
		props: {
			list: {
				type: [Array],
				default () {
					return []
				}
			},
			option: { //当前页面信息，从哪里点进的
				type: Object,
				default () {
					return {}
				}
			},
			titleId: { //当前tab名称
				type: [Number, String],
				default () {
					return ''
				}
			},
		},
		data() {
			return {
			}
		},
		mounted() {
		},
		methods: {
			printingRecord(item){
				uni.navigateTo({
					url:'../printingRecord/printingRecord?id='+item.id
				})
			},
			navigetTo(item) {
				if(this.option.name=='我的印章'){//我的印章
					if(item.uuid&&item.uuid.includes('DT')){
						uni.navigateTo({
							url:'../../bluetooth/IntelligentSeal/IntelligentSeal?id='+item.id
						})
					}else{
						uni.navigateTo({
							url:'../sealDetails/sealDetails?id='+item.id
						})
					}


				}else{//印章指纹
					uni.navigateTo({
						url:'../sealFingerprint/sealFingerprint?id='+item.id
					})
				}
			}
		}

	}
</script>

<style lang="scss">
	.good-list {
		background-color: #fff;
		width: 100%;
		.icon-yinzhang {
			font-size: 50rpx;
			color: #007AFF;
			display: flex;justify-content: center;align-items: center;margin-right: 20rpx;height: 140rpx;
		}
		.u-cell-group {
			font-size:28rpx;color: #888;line-height: 48rpx;width: 445rpx;
			box-sizing: border-box;
			display: flex;flex-direction: column;
		}
		.footer{
			display: flex;justify-content: center;align-items: center;height: 140rpx;
		}
	}
</style>
